package com.wongsir.tiny_spring_reproduce.beans;

/**
 * 	 在spring中此类用于Bean配置文件的属性承载。<br/>
 * 	在本项目中此类的作用是：接收bean的内容及元数据，将其保存在BeanFactory中，同时包装bean的实体。
 * @author hjd
 * @date 2018年8月27日
 */
public class BeanDefinition {
	
	private Object bean;
	
	private Class beanClass;
	
	private String beanClassName;
	
	private PropertyValues propertyValues = new PropertyValues();
	
	public BeanDefinition() {
		
	}

	public Object getBean() {
		return bean;
	}

	public void setBean(Object bean) {
		this.bean = bean;
	}

	public Class getBeanClass() {
		return beanClass;
	}

	public void setBeanClass(Class beanClass) {
		this.beanClass = beanClass;
	}

	public String getBeanClassName() {
		return beanClassName;
	}

	public void setBeanClassName(String beanClassName) {
		this.beanClassName = beanClassName;
		try {
			//通过类名获取类
			this.beanClass = Class.forName(beanClassName);
		} catch (ClassNotFoundException e) {
			e.printStackTrace();
		}
	}

	public PropertyValues getPropertyValues() {
		return propertyValues;
	}

	public void setPropertyValues(PropertyValues propertyValues) {
		this.propertyValues = propertyValues;
	}
	
}
